﻿using AutoMapper;
using B.S.Filtration.Domain;
using B.S.Filtration.Domain.专检;
using B.S.Filtration.Domain.到货检验;
using B.S.Filtration.Domain.工单;
using B.S.Filtration.Write.Api.Application.Command.AbnormalCommand;
using B.S.Filtration.Write.Api.Application.Command.Cleaning;
using B.S.Filtration.Write.Api.Application.Command.ContactCommand;
using B.S.Filtration.Write.Api.Application.Command.ContactPhone;
using B.S.Filtration.Write.Api.Application.Command.ContactPhoneCommand;
using B.S.Filtration.Write.Api.Application.Command.CustomerPhoneCommand;
using B.S.Filtration.Write.Api.Application.Command.DOM;
using B.S.Filtration.Write.Api.Application.Command.DOMDetails;
using B.S.Filtration.Write.Api.Application.Command.Feeding;
using B.S.Filtration.Write.Api.Application.Command.FiltrateCommand;
using B.S.Filtration.Write.Api.Application.Command.PowerCommand;
using B.S.Filtration.Write.Api.Application.Command.ProcessCommand;
using B.S.Filtration.Write.Api.Application.Command.ProcessMonitoringCommand;
using B.S.Filtration.Write.Api.Application.Command.ProductionTaskCommand;
using B.S.Filtration.Write.Api.Application.Command.SaleCommand;
using B.S.Filtration.Write.Api.Application.Command.Tickets;
using B.S.Filtration.Write.Api.Application.Command.VendorItems;
using B.S.Filtration.Write.Api.Application.Command.VendorItemsCommand;
using B.S.Filtration.Write.Api.Application.Command.Ventor;
using B.S.Filtration.Write.Api.Application.Command.到货检验.BasicInfoCommand;
using B.S.Filtration.Write.Api.Application.Command.到货检验.PurchaseInfoCommand;
using B.S.Filtration.Write.Api.Application.Command.到货检验.QualityLnspectionCommnad;
using B.S.Filtration.Write.Api.Application.Command.到货检验.QualityReportWorkCommand;

namespace B.S.Filtration.Write.Api
{
    public class AutoMapperProfile : Profile
    {
        public AutoMapperProfile()
        {
            //设备清洗
            CreateMap<Cleaning, AddCleaningCommand>().ReverseMap();
            CreateMap<Cleaning, DeleteCleaningCommand>().ReverseMap();
            CreateMap<Cleaning, UpdateCleaningCommand>().ReverseMap();

            //过程监控
            CreateMap<ProcessMonitoring, AddProcessMonitoringCommand>().ReverseMap();
            CreateMap<ProcessMonitoring, UpdateProcessMonitoringCommand>().ReverseMap();
            CreateMap<ProcessMonitoring, DelProcessMonitoringCommand>().ReverseMap();

            //工序列表
            CreateMap<Process, AddProcessCommand>().ReverseMap();
            CreateMap<Process, UpdateProcessCommand>().ReverseMap();
            CreateMap<Process, DelProcessCommand>().ReverseMap();

            //动力准备
            CreateMap<Power, CreatePowerCommand>().ReverseMap();
            CreateMap<Power, UpdPowerCommand>().ReverseMap();

            //发酵液列表
            CreateMap<Filtrate, CreateFiltrateCommand>().ReverseMap();
            CreateMap<Filtrate, UpdFiltrateCommand>().ReverseMap();


            //专检申请表
            CreateMap<ProductionTask, AddProductionTaskCommand>().ReverseMap();
            CreateMap<ProductionTask, UpdateProductionTaskCommand>().ReverseMap();

            //工序分类
            CreateMap<ProcessType, AddProcessTypeCommand>().ReverseMap();
            CreateMap<ProcessType, UpdateProcessTypeCommand>().ReverseMap();

            //新工序   
            CreateMap<Procedure, AddProcedureCommand>().ReverseMap();
            CreateMap<Procedure, UpdateProcedureCommand>().ReverseMap();

            //工艺
            CreateMap<Craftsmanship, AddCraftsmanshipCommand>().ReverseMap();
            CreateMap<Craftsmanship, UpdateCraftsmanshipCommand>().ReverseMap();
            CreateMap<CraftProcedure, AddCraftProcedureCommand>().ReverseMap();

            //发酵液
            CreateMap<Filtrate, CreateFiltrateCommand>().ReverseMap();
            CreateMap<Filtrate, UpdFiltrateCommand>().ReverseMap();

            //异常处理表
            CreateMap<Abnormal, AddAbnormalCommand>().ReverseMap();
            CreateMap<Abnormal, UpdateAbnormalCommand>().ReverseMap();
            CreateMap<Abnormal, DelAbnormalCommand>().ReverseMap();

            //到货检验基本信息
            CreateMap<BasicInfo, AddAbnormalCommand>().ReverseMap();
            CreateMap<BasicInfo, UpdateAbnormalCommand>().ReverseMap();
            CreateMap<BasicInfo, DelAbnormalCommand>().ReverseMap();

            CreateMap<ProductionTask, DelProductionTaskCommand>().ReverseMap();

            CreateMap<Feeding, AddFeedingCommand>().ReverseMap();
            CreateMap<Feeding, DeleteFeedingCommand>().ReverseMap();
            CreateMap<Feeding, UpdateFeedingCommand>().ReverseMap();

            CreateMap<Tickets, AddTicketCommand>().ReverseMap();
            CreateMap<Tickets, DeleteTicketCommand>().ReverseMap();
            CreateMap<Tickets, UpdateTicketCommand>().ReverseMap();

            CreateMap<DOM, AddDOMCommand>().ReverseMap();
            CreateMap<DOM, UpdateDOMCommand>().ReverseMap();
            CreateMap<DOM, DeleteDOMCommand>().ReverseMap();

            CreateMap<Vendor, AddVentorCommand>().ReverseMap();
            CreateMap<Vendor, UpdateVentorCommand>().ReverseMap();
            CreateMap<Vendor, DeleteVentorCommand>().ReverseMap();

            CreateMap<ContactPhones, AddContactPhoneCommand>().ReverseMap();
            CreateMap<ContactPhones, UpdateContactPhoneCommand>().ReverseMap();

            CreateMap<VendorItems, AddVendorItemsCommand>().ReverseMap();
            CreateMap<VendorItems, UpdVendorItemsCommand>().ReverseMap();
            CreateMap<Filtrate, UpdFiltrateCommand>().ReverseMap();

            //异常处理表
            CreateMap<Abnormal, AddAbnormalCommand>().ReverseMap();
            CreateMap<Abnormal, UpdateAbnormalCommand>().ReverseMap();
            CreateMap<Abnormal, DelAbnormalCommand>().ReverseMap();

            //到货检验基本信息
            CreateMap<BasicInfo, AddBasicInfoCommand>().ReverseMap();
            CreateMap<BasicInfo, UpdateBasicInfoCommand>().ReverseMap();
            CreateMap<BasicInfo, DelBasicInfoCommand>().ReverseMap();
            //到货检验明细表
            CreateMap<PurchaseInfo, AddPurchaseInfoCommand>().ReverseMap();
            CreateMap<PurchaseInfo, UpdatePurchaseInfoCommand>().ReverseMap();
            CreateMap<PurchaseInfo, DelPurchaseInfoCommand>().ReverseMap();

            //质检工单
            CreateMap<QualityLnspection, AddQualityLnspectionCommnad>().ReverseMap();
            CreateMap<QualityLnspection, DelQualityLnspectionCommnad>().ReverseMap();
            CreateMap<QualityLnspection, UpdateQualityLnspectionCommnad>().ReverseMap();

            //质检报工
            CreateMap<QualityReportWork, AddQualityReportWorkCommand>().ReverseMap();
            CreateMap<QualityReportWork, DelQualityReportWorkCommand>().ReverseMap();
            CreateMap<QualityReportWork, UpdateQualityReportWorkCommand>().ReverseMap();

            CreateMap<Filtrate, UpdFiltrateCommand>().ReverseMap();

            CreateMap<DOMDetails, AddDOMDetailsCommand>().ReverseMap();
            CreateMap<DOMDetails, UpdateDOMDetailsCommand>().ReverseMap();
            CreateMap<DOMDetails, DeleteDOMDetailsCommand>().ReverseMap();

            //销售记录信息
            CreateMap<CreateSaleCommand, Sale>().ReverseMap();
            CreateMap<UpdSaleCommand, Sale>().ReverseMap();

            //销售记录信息
            CreateMap<CreateContactCommand, Contact>().ReverseMap();
            CreateMap<UpdContactCommand, Contact>().ReverseMap();

            //客户信息
            CreateMap<CreateCustomerPhoneCommand, CustomerPhone>().ReverseMap();
            CreateMap<UpdCustomerPhoneCommand, CustomerPhone>().ReverseMap();
            //联系人
            CreateMap<CreateContactPhoneCommand, ContactPhoneModel>().ReverseMap();
            CreateMap<UpdContactPhoneCommand, ContactPhoneModel>().ReverseMap();
        }
    }
}
